<?php

/**
 * contact actions.
 *
 * @package    pujalift
 * @subpackage contact
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class contactActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
	$this->form = new ContactForm();
	
	 if ($request->isMethod('post'))
    {
      $this->form->bind($request->getParameter('contact'));
      if ($this->form->isValid()){
		$text = "Nuevo contacto de sanziniafilms.com.\n\nNombre:".$this->form->getValue('name')."\nE-mail: ".$this->form->getValue('email')."\nMotivo: ".$this->form->getValue('subject')."\nMensaje: ".$this->form->getValue('message');
		
		$this->getMailer()->composeAndSend(
			$this->form->getValue('email'),
			sfConfig::get('app_email_to'),
			'Sanzinia Films formulario de contacto',
			$text
		);
		
        $this->redirect('@enviado');
	}
	  
    }
	$this->getResponse()->setTitle("Contacto | Sanzinia Films");
  }
  
  public function executeSubmit(sfWebRequest $request)
  {
  }
}
